import { addCart } from '@/network/cart'
import  store  from '@/store'

export function toGoodsDetail(skuId) {
    window.open('/detail/' + skuId)
}


export function addCartData(skuId,nums,is_Delete = 0) {
        let requstData = {
            sku_id:skuId,
            nums,
            is_delete:is_Delete
        }
        addCart(requstData).then(res => {
            if(typeof res == 'string') {
                alert(res)
            }else {
                alert('添加成功')
            }
            store.dispatch('updateCart')
        })
}



